package com.neutech.demo;

import com.neutech.service.UserService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;


public class Demo1 {
    public static void main(String[] args) {
        //创建容器
        ApplicationContext context=new ClassPathXmlApplicationContext("app.xml");
//        UserDAO userDAO= (UserDAO) context.getBean("userDAO");
        //从容器中取出对象 getBean不仅可以通过名去拿，还可以通过类型去拿
        UserService userService=context.getBean(UserService.class);
        userService.listALL();

    }
}
